
package com.zhu.salesmanagement.models;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 拜访状态数据项
 */

public class VisitTaskInfo implements Parcelable {

    public static final int STORE_DEALER = 2;

    public String id = "-1";
    public int itemId = 100;
    public String mName;
    public String mAddress;
    public double mLongitude;
    public double mLatitude;
    public boolean isVisited;
    public boolean isClosed;
    public int type = 0;
    public String mCheckinTime = "";
    public String mCheckoutTime = "";
    public long mDbId = -1;
    public int iVisitCategory;
    public int iProperty = 0;
    public boolean hasRemind = false;
    public String sAreaID;
    public String sDealtSalesPerson;
    public String sCRCNearTime;
    public String sSCNearTime;
    public String sStoreCategory;
    public String sCheckResult;
    public String sCheckInfo;
    public boolean canPut;
    public boolean isPutSuccess;
    public String sMsg;
    public boolean needDownload = true;
    public String mDatingTaskActualID;

    @Override
    public int describeContents() {
        // TODO Auto-generated method stub
        return 0;
    }

    @Override
    public void writeToParcel(Parcel arg0, int arg1) {
        // TODO Auto-generated method stub
        arg0.writeString(id);
        arg0.writeString(mName);
        arg0.writeDouble(mLongitude);
        arg0.writeDouble(mLatitude);
        arg0.writeInt(isVisited ? 1 : 0);
        arg0.writeInt(type);
        arg0.writeString(mCheckinTime);
        arg0.writeString(mCheckoutTime);
        arg0.writeLong(mDbId);
        arg0.writeString(mAddress);
        arg0.writeString(sAreaID);
        arg0.writeString(sDealtSalesPerson);
        arg0.writeString(sCRCNearTime);
        arg0.writeString(sSCNearTime);
        arg0.writeString(sStoreCategory);
        arg0.writeString(sCheckResult);
        arg0.writeString(sCheckInfo);
        arg0.writeInt(canPut ? 1 : 0);
        arg0.writeInt(isPutSuccess ? 1 : 0);
        arg0.writeString(sMsg);
        arg0.writeString(mDatingTaskActualID);

    }

    public static final Parcelable.Creator<VisitTaskInfo> CREATOR = new Creator<VisitTaskInfo>() {
        @Override
        public VisitTaskInfo createFromParcel(Parcel source) {
            VisitTaskInfo info = new VisitTaskInfo();
            info.id = source.readString();
            info.mName = source.readString();
            info.mLongitude = source.readDouble();
            info.mLatitude = source.readDouble();
            info.isVisited = source.readInt() == 1 ? true : false;
            info.type = source.readInt();
            info.mCheckinTime = source.readString();
            info.mCheckoutTime = source.readString();
            info.mDbId = source.readLong();
            info.mAddress = source.readString();
            info.sAreaID = source.readString();
            info.sDealtSalesPerson = source.readString();
            info.sCRCNearTime = source.readString();
            info.sSCNearTime = source.readString();
            info.sStoreCategory = source.readString();
            info.sCheckResult = source.readString();
            info.sCheckInfo = source.readString();
            info.canPut = source.readInt() == 1 ? true : false;
            info.isPutSuccess = source.readInt() == 1 ? true : false;
            info.sMsg = source.readString();
            info.mDatingTaskActualID = source.readString();
            return info;
        }

        @Override
        public VisitTaskInfo[] newArray(int arg0) {
            return new VisitTaskInfo[arg0];
        }
    };

}
